package com.haoshuang.zhouzhoubang.ui.page.mine.wallet.frozen.record

import com.haoshuang.zhouzhoubang.model.api.ApiRepo
import com.haoshuang.zhouzhoubang.model.bean.DepositGroupByDayBean
import com.mufeng.libs.base.BaseViewModel
import com.mufeng.libs.net.ResponseBean
import com.mufeng.libs.net.netRequest
import com.mufeng.libs.state.StateData
import com.mufeng.libs.state.StatefulMutableLiveData

class FrozenAmountRecordViewModel : BaseViewModel() {

    /**
     * 冻结金额记录
     */
    val getMasterDepositGroupByDayListData = StatefulMutableLiveData<ResponseBean<DepositGroupByDayBean>>()
    fun getMasterDepositGroupByDayList(fcate_id: String, is_team: Int) = netRequest {
        start { getMasterDepositGroupByDayListData.value = StateData.Loading }
        request { ApiRepo.getMasterDepositGroupByDayList(fcate_id, is_team)  }
        success { getMasterDepositGroupByDayListData.value = StateData.Success(it) }
        error { code, msg ->
            getMasterDepositGroupByDayListData.value = StateData.Error(code, msg)
        }
    }

}